import store from "./Store"
const lang = store.state.lang

import { Methods as workPanelMethods } from "@/Store/WorkPanel"
import { Methods as webserverMethods } from "@/Store/WebServer"

const navs = {
    navInitialize: [
        {
            link: "/Languages",
            text: () => lang.language,
            image: "static/img/language.png"
        },
        {
            link: "/Initialize",
            text: () => lang.initialize,
            image: "static/img/database.svg"
        }
    ]
}

export async function bootApplication() {
    store.dispatch("lang/management/loadDefault") // كۆرۈنمە يۈز ئىشلىتىدىغان تىل غا ئالاقىدار بايلىقلارنى دەسلەپلەشتۈرۈش

    const serverStatus = await webserverMethods.getStatus(store)
    const serverReady = serverStatus.superUserInitialized
    
    if (!serverReady){
        workPanelMethods.setNavs(store, navs.navInitialize)
    // workPanelMethods.setCurrentNavIndex(store, 1)
    }
}